﻿package{
	
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.events.Event;
	import flash.media.Sound;
	
	public class GUI_TitleButton extends MovieClip{
		
		
		private var snd_MenuOver:Sound = new MenuOver();
		private var snd_MenuClick:Sound = new MenuClick();
		
		
		
		public function GUI_TitleButton() {
			
			//addEventListener(Event.ADDED_TO_STAGE, Init);
			
			stop();
			
			addEventListener(MouseEvent.ROLL_OVER, onOver);
			addEventListener(MouseEvent.ROLL_OUT, onOut);
			addEventListener(MouseEvent.MOUSE_UP, onClick);
		}
		
		private function Init(e:Event) {
			//removeEventListener(Event.ADDED_TO_STAGE, Init);
			
			
		}
		
		private function onOver(e:MouseEvent) {
			if (this.currentFrame == 33) return;
			
			
			if (parent is GUI_SoundButton) {
				
			}else{
				GUI_Cursor.cursor.setCursor(3);
			}
			
			
			//trace("onOver");
			snd_MenuOver.play();
			gotoAndPlay("Enter");
			
		}
		
		private function onOut(e:MouseEvent) {
			if (this.currentFrame == 33) return;
			
			GUI_Cursor.cursor.setCursor(0);
			//trace("onOut");	
			gotoAndStop("Normal");
			
		}
		
		private function onClick(e:MouseEvent) {
			if (this.currentFrame == 33) return;
			//trace("onClick");
			
			snd_MenuClick.play();
			gotoAndPlay("Push");
			
			
		}
		
		
		
	}
	
	
	
	
}